<script type="text/javascript" src="js/jquery.autocomplete.js"></script>

<?
@session_start();

include ("funct.php");
#zmienne();
if ($_GET['page']=='add'){
echo '<p><font color="red">UWAGA ! Pacjent musi być wyszukany przez pole nazwisko<br>W innym przypadku zapis nie będzie możliwy</font></p>';
$ofzetsec = ($_GET['offset'] * 60 * 60);
echo '<b>';
echo date('Y-m-d H:i',($_GET['start']/1000) - ($ofzetsec ));
echo '<br>';
echo date('Y-m-d H:i',($_GET['end']/1000) - ($ofzetsec ));
echo '</b>';
include("pacjenci.php");
echo '<input type="hidden" id="start" name="start" value="'.$_GET['start'].'"/>';
echo '<input type="hidden" id="end" name="end" value="'.$_GET['end'].'"/>';
echo '<input type="hidden" id="calendarid" name="calendarid" value="'.$_SESSION['wyb_gab'].'"/>';
}
if ($_GET['page']=='edit'){

$sql='select * From calendarevents WHERE calendarid='.$_SESSION['wyb_gab'].' and eventid='.$_GET['id'];
$result = mysql_query($sql);
while ($row = mysql_fetch_assoc($result)) {
    $wiz_ed=$row;
}

$sql="select pac.id, pac.pac_imie, pac.pac_nazwisko, pac.pac_telefon, wizyty.typ_wiz from pac, wizyty where pac.id = wizyty.id_pac and wizyty.id=".$wiz_ed['id_wiz'];
$result = mysql_query($sql);
while ($row = mysql_fetch_assoc($result)) {
    $wiz_det=$row;
}

$_SESSION['imie']=$wiz_det['pac_imie'];
$_SESSION['nazw']=$wiz_det['pac_nazwisko'];
$_SESSION['tel']=$wiz_det['pac_telefon'];
$_SESSION['wyb_pac_id']=$wiz_det['id'];

$ofzetsec = ($_GET['offset'] * 60 * 60);
echo '<b>';
echo date('Y-m-d H:i',($wiz_ed['eventstart']/1000));
echo '<br>';
echo date('Y-m-d H:i',($wiz_ed['eventend']/1000));
echo '</b>';

include("pacjenci.php");
echo '<input type="hidden" id="start" name="start" value="'.$wiz_ed['eventstart'].'"/>';
echo '<input type="hidden" id="end" name="end" value="'.$wiz_ed['eventend'].'"/>';
echo '<input type="hidden" id="id" name="id" value="'.$wiz_ed['eventid'].'"/>';
echo '<input type="hidden" id="id_wiz" name="id_wiz" value="'.$wiz_ed['id_wiz'].'"/>';
echo '<input type="hidden" id="calendarid" name="calendarid" value="'.$_SESSION['wyb_gab'].'"/>';

#zmienne();
}
?>



